<div xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ice="http://www.icesoft.com/icefaces/component">
	<ice:dataTable binding="#{ioPLocalIPRangeConfigBean.dataTable}"
		value="#{ioPLocalIPRangeConfigBean.dataList}" var="dataItem" id="localIPRangeList">
		<f:facet name="header">
			<ice:outputText value="Local IP Range" />
		</f:facet>
		<ice:column>
			<ice:selectBooleanCheckbox
				value="#{ioPLocalIPRangeConfigBean.selectedRow}"
				disabled="#{ioPLocalIPRangeConfigBean.editModeRow}"
				rendered="#{ioPLocalIPRangeConfigBean.selectMultiple}" />
		</ice:column>
		<ice:column>
			<f:facet name="header">
				<ice:outputText value="ID" />
					<ice:commandSortHeader columnName="#{ioPLocalIPRangeConfigBean.idValue}"
						arrow="true">
						<ice:outputText value="#{ioPLocalIPRangeConfigBean.idValue}"/>
					</ice:commandSortHeader>
			</f:facet>
			<ice:outputText value="#{dataItem.id}" rendered="#{dataItem.id != 0}" />
			<ice:outputText value="new" rendered="#{dataItem.id == 0}" />
		</ice:column>
		<ice:column>
			<f:facet name="header">
			<ice:outputText value="Prefix"></ice:outputText>
			</f:facet>
			<ice:outputText value="#{dataItem.prefix}"
				rendered="#{!ioPLocalIPRangeConfigBean.editModeRow}" />
			<ice:inputText value="#{dataItem.prefix}"
				rendered="#{ioPLocalIPRangeConfigBean.editModeRow}" required="true"
				id="prefix"/>
				<ice:message errorClass="errors"  for="prefix" />
		</ice:column>

		<ice:column>
			<f:facet name="header">
				<ice:outputText value="Prefix Length" />
			</f:facet>
			<ice:outputText value="#{dataItem.prefix_len}"
				rendered="#{!ioPLocalIPRangeConfigBean.editModeRow}" />
			<ice:inputText value="#{dataItem.prefix_len}"
				rendered="#{ioPLocalIPRangeConfigBean.editModeRow}" required="true"
				id="prefixLength"/>
				<ice:message errorClass="errors"  for="prefixLength" />
		</ice:column>
		<ice:column>
			<f:facet name="header">
				<ice:outputText value="AS Path Length" />
			</f:facet>
			<ice:outputText value="#{dataItem['ASPathLength']}"
				rendered="#{!ioPLocalIPRangeConfigBean.editModeRow}" />
			<ice:inputText value="#{dataItem['ASPathLength']}"
				rendered="#{ioPLocalIPRangeConfigBean.editModeRow}" id="ASPathLength"
				 />
				 <ice:message errorClass="errors"  for="ASPathLength" />
		</ice:column>
		<ice:column>
			<f:facet name="header">
				<ice:outputText value="MED" />
			</f:facet>
			<ice:outputText value="#{dataItem['MED']}"
				rendered="#{!ioPLocalIPRangeConfigBean.editModeRow}" />
			<ice:inputText value="#{dataItem['MED']}"
				rendered="#{ioPLocalIPRangeConfigBean.editModeRow}" id="MED"/>
				<ice:message errorClass="errors"  for="MED" />
		</ice:column>
		<ice:column>
			<f:facet name="header">
				<ice:outputText value="Local Preference" />
			</f:facet>
			<ice:outputText value="#{dataItem.localPreference}"
				rendered="#{!ioPLocalIPRangeConfigBean.editModeRow}" />
			<ice:inputText value="#{dataItem.localPreference}"
				rendered="#{ioPLocalIPRangeConfigBean.editModeRow}"
				id="localPreference"/>
				<ice:message errorClass="errors"  for="localPreference" />
		</ice:column>
		
	<!-- Control buttons -->
		<f:facet name="footer">
			<ice:panelGrid columns="4">
					<ice:commandButton value="ADD"
						action="#{ioPLocalIPRangeConfigBean.actionAdd}" 
						rendered="#{!ioPLocalIPRangeConfigBean.editMode}"/>
					<ice:commandButton value="EDIT"
						action="#{ioPLocalIPRangeConfigBean.actionEdit}"
						rendered="#{!ioPLocalIPRangeConfigBean.editMode}"/>
					<ice:commandButton value="DELETE"
						action="#{ioPLocalIPRangeConfigBean.actionDelete}"
						rendered="#{!ioPLocalIPRangeConfigBean.editMode}"/>
					<ice:commandButton value="SAVE"
						action="#{ioPLocalIPRangeConfigBean.actionSave}"
						rendered="#{ioPLocalIPRangeConfigBean.editMode}"/>
					<ice:commandButton value="CANCEL"
						action="#{ioPLocalIPRangeConfigBean.actionRefresh}"
						immediate="true"
						rendered="#{ioPLocalIPRangeConfigBean.editMode}" />
			</ice:panelGrid>
		</f:facet>
	</ice:dataTable>

	
	<!-- Paginator with page controls for data table -->
		<ice:dataPaginator id="dataScroll_3" for="localIPRangeList"
			paginator="true" fastStep="3" paginatorMaxPages="4">
			<f:facet name="first">
				<ice:graphicImage url="/xmlhttp/css/rime/css-images/arrow-first.gif"
					style="border:none;" title="First Page" />
			</f:facet>
			<f:facet name="last">
				<ice:graphicImage url="/xmlhttp/css/rime/css-images/arrow-last.gif"
					style="border:none;" title="Last Page" />
			</f:facet>
			<f:facet name="previous">
				<ice:graphicImage
					url="/xmlhttp/css/rime/css-images/arrow-previous.gif"
					style="border:none;" title="Previous Page" />
			</f:facet>
			<f:facet name="next">
				<ice:graphicImage url="/xmlhttp/css/rime/css-images/arrow-next.gif"
					style="border:none;" title="Next Page" />
			</f:facet>
			<f:facet name="fastforward">
				<ice:graphicImage url="/xmlhttp/css/rime/css-images/arrow-ff.gif"
					style="border:none;" title="Fast Forward" />
			</f:facet>
			<f:facet name="fastrewind">
				<ice:graphicImage url="/xmlhttp/css/rime/css-images/arrow-fr.gif"
					style="border:none;" title="Fast Backwards" />
			</f:facet>
		</ice:dataPaginator>

		<!-- Display counts about the data table and the currently displayed page -->
		<ice:dataPaginator id="dataScroll_2" for="localIPRangeList"
			rowsCountVar="rowsCount" displayedRowsCountVar="displayedRowsCount"
			firstRowIndexVar="firstRowIndex" lastRowIndexVar="lastRowIndex"
			pageCountVar="pageCount" pageIndexVar="pageIndex">
			<ice:outputFormat
				value="{0} records found, displaying {1} record(s), from {2} to {3}. Page {4} / {5}."
				styleClass="standard">
				<f:param value="#{rowsCount}" />
				<f:param value="#{displayedRowsCount}" />
				<f:param value="#{firstRowIndex}" />
				<f:param value="#{lastRowIndex}" />
				<f:param value="#{pageIndex}" />
				<f:param value="#{pageCount}" />
			</ice:outputFormat>
		</ice:dataPaginator>
	
</div>